package test.resource

import com.gitee.ixtf.vertx.Subscription
import io.vertx.kotlin.core.json.json
import io.vertx.kotlin.core.json.obj
import kotlinx.coroutines.flow.flow
import org.eclipse.microprofile.graphql.GraphQLApi

@GraphQLApi
class SubscriptionResource {
  @Subscription
  fun TestFlow() = flow {
    emit(json { obj("id" to "id1", "name" to "name") })
    emit(json { obj("id" to "id2", "name" to "name") })
  }
}
